Introduction

SMAC Platform is a cloud-based online service. Using the Microsoft Windows Azureā„¢ infrastructure, SMAC Platform dynamically scales up to any performance or space requirement. All data transfer to and from BWS is secured with strong TLS/SSL encryption.

Access to SMAC Platform is done via a HTTP based RESTful Web API. This web API is accessible via standard HTTP methods by a variety of HTTP clients including browsers and mobile devices.

We provide Swagger UI to visualize and interact with SMAC Platform API.

Authorization

In order to use SMAC Platform API, you must sign up for an account with a confirmed email address. A bearer token and an API key are required to authenticate you with SMAC Platform API.

You can identify which authorization component(s) is required by clicking the icon, for each of the APIs at the Swagger UI. The following are the possible dialogs, each indicating the required authorization(s).

...

Bearer authorization required.

...

API Key authorization required.

...

Both authorizations required.

Bearer Token

Bearer token is required by all APIs which perform operations related to the user account. A bearer token is returned upon calling api/Users/authenticate. Expired token can be renewed by calling api/Users/refresh-token.

The token must be sent in the Authorization header when making requests.

Authorization: Bearer <token>

API Key

In addition to bearer token, some APIs require API key. API keys can be created in API Keys Management.

The API key is sent in the request header.

X-SMAC-PLATFORM-API-KEY: <key>

Postman as Test Tool

Postman is an API platform for building and using APIs. Download the Postman application using the following steps:

  1. Download and install Postman from https://www.postman.com/downloads.

  2. Once you have installed Postman and started it, in the Workspace view, click the Import button.

    1. Choose Link and enter URL, https://smac-poc.mcs-group.com.my/swagger/v1/swagger.json.

      ...

      Postman - Import Link
    2. Click Continue, followed by Import to start importing.

      ...

      Postman - Import
  3. In Collections, select the newly imported API.

    1. Select Pre-request Script tab.

      ...

      Postman - API Key
      1. Enter the following line, replacing [ApiKey] with your API Key.
        pm.request.addHeader({key: "X-SMAC-PLATFORM-API-KEY", value: "{{ApiKey}}"})
        
    2. Select Authorization tab.

      ...

      Postman - Authorization
      1. Select Bearer Token for Type.
      2. Enter your bearer token in Token.
        • You can obtain the bearer token by executing /api/Users/authenticate API.